package Framework;
// Keyboard object, it's a keyboard. Go figure. 

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JPanel;


public class wig_Keyboard extends JPanel implements ActionListener {
	
	static Vector <btn_Ancestor> btn_Numpad;
	static Vector <btn_Ancestor> btn_Querty;
	
	static String is_QuertyLayout = "1234567890QWERTYUIOPASDFGHJKLZXCVBNM ";
	
	public wig_Keyboard() {
		
		this.setBounds(0,0,800,600);
		this.setLayout(null);
		
		if (btn_Querty == null){
			for (int i = 0; i < 10; i ++){
				//String s = i;
				//Convert i to a string
				btn_Numpad.add(new btn_Ancestor(is_QuertyLayout.substring(9 - i, 8 - i)));
				btn_Numpad.lastElement().addActionListener(this);
			}
			for (int i = 0; i < is_QuertyLayout.length(); i++){
				btn_Querty.add(new btn_Ancestor(is_QuertyLayout.substring(i, i+1)));
			}
		}
		
	}
	
	
	public void actionPerformed(ActionEvent e) {
		String METHOD = "actionPerformed()";
		btn_Ancestor anc_Btn = (btn_Ancestor) e.getSource();
		
		System.out.println(anc_Btn.getText());
	}
	
}
